package com.summer.core.xml.parser;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.Element;

import com.summer.core.util.SysPath;
import com.summer.core.util.XmlHelper;

public class TableParser {
	  private static final String configFile = SysPath.getRealPath("table_import.xml");
	    private static List<String> importList=null;
	    public static List<String> parseXml() {
	    	importList=new ArrayList<String>();
	        try {
	            Document doc = XmlHelper.parseXml(configFile);
	            List nodes = doc.selectNodes("//import/table");
	            Iterator<Element> i = nodes.iterator();
	            while(i.hasNext()) {
	                Element temp = i.next();
	                String table = temp.getText();
	                importList.add(table);
	                }
	        	}catch(Exception e){
	        }
	      return importList;
	    }
}
